<template>
  <div class="app-container">
    <el-card style="border-radius: 10px">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="85px">
      <el-form-item label="盘点单编号" prop="sn">
        <el-input
          v-model="queryParams.sn"
          placeholder="请输入库存盘点单编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="仓库名称" prop="warehouseName">
        <el-input
          v-model="queryParams.warehouseName"
          placeholder="请输入仓库名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="库区名称" prop="locationName">
        <el-input
          v-model="queryParams.locationName"
          placeholder="请输入库区名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="库位名称" prop="areaName">
        <el-input
          v-model="queryParams.areaName"
          placeholder="请输入库位名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="盘点人" prop="inventoryPerson">
        <el-input
          v-model="queryParams.inventoryPerson"
          placeholder="请输入盘点人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="请选择盘点状态" clearable>
          <el-option label="未盘点" value="0"></el-option>
          <el-option label="盘点中" value="1"></el-option>
          <el-option label="已提交" value="2"></el-option>
          <el-option label="已处理" value="3"></el-option>
        </el-select>

      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    </el-card>
    <div style="height: 15px"></div>
    <el-card style="border-radius: 10px">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['mes:wm:pandian:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['mes:wm:pandian:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">

      </el-col>
<!--      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['mes:wm:pandian:export']"
        >导出</el-button>
      </el-col>-->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="pandianList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
<!--      <el-table-column label="主键ID" align="center" prop="id" />-->
      <el-table-column label="库存盘点单编号" align="center" prop="sn" >
        <template slot-scope="scope">
          <el-button
            type="text"
            @click="handleView(scope.row)"
          >{{scope.row.sn}}</el-button>
        </template>
      </el-table-column>

      <el-table-column label="盘点范围" align="center" prop="inventoryRange" />
      <el-table-column label="盘点方法" align="center" prop="inventoryMethod" />

<!--      <el-table-column label="仓库名称" align="center" prop="warehouseName" />
      <el-table-column label="库区名称" align="center" prop="locationName" />
      <el-table-column label="库位名称" align="center" prop="areaName" />-->

      <el-table-column label="盘点人" align="center" prop="inventoryPerson" />
      <el-table-column label="盘点时间" align="center" prop="inventoryTime" >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.inventoryTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="状态" align="center" prop="status" >
        <template slot-scope="scope">
          <el-tag v-if="scope.row.status === '3'"  type="success">已处理</el-tag>
          <el-tag v-if="scope.row.status === '2'"  type="warning">已提交</el-tag>
          <el-tag v-if="scope.row.status === '0'"  type="danger">未盘点</el-tag>
          <el-tag v-if="scope.row.status === '1'"  >盘点中</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="盘点说明" align="center" prop="inventoryDesc" />
<!--      <el-table-column label="审核时间" align="center" prop="auditTime" />
      <el-table-column label="审核人名称" align="center" prop="auditPersonName" />-->
      <el-table-column label="操作" width="230px" fixed="right" align="center"  >
<!--        状态('0'未盘点1盘点中2已提交3已处理)-->
        <template slot-scope="scope">

              <el-button
                size="mini"
                type="text"
                icon="el-icon-printer"
                @click="handlePrint(scope.row)"
                v-if="scope.row.status == '0' ||scope.row.status == '1'"
                v-hasPermi="['mes:wm:pandian:query']"
              >打印</el-button>

            <el-button
              size="mini"
              type="text"
              icon="el-icon-s-check"
              @click="tijiao(scope.row)"
              v-if="scope.row.status == '1'"
              v-hasPermi="['mes:wm:pandian:edit']"
            >提交</el-button>

            <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-if="scope.row.status !== '2' && scope.row.status !== '3'"
              v-hasPermi="['mes:wm:pandian:edit']"
            >盘点</el-button>


            <el-button
              size="mini"
              type="text"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-if="scope.row.status == '0' || scope.row.status == '1'"
              v-hasPermi="['mes:wm:pandian:remove']"
            >删除</el-button>

            <el-button
              type="text"
              icon="el-icon-s-platform"
              size="mini"
              v-if="scope.row.status == '2'"
              @click="handlePlusAndLoss(scope.row)"
            >盈亏处理</el-button>

        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    </el-card>
    <!-- 添加或修改库存盘点对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1100px" append-to-body @close="handleClose">
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="盘点编号" prop="sn">
              <el-input v-model="form.sn" :readonly="optType !== 'add'"></el-input>
            </el-form-item>
          </el-col>
<!--          <el-col :span="4">
            <el-form-item label-width="80">
              <el-switch v-model="autoGenFlag"
                         active-color="#13ce66"
                         active-text="自动生成"
                         @change="handleAutoGenChange(autoGenFlag)" >
              </el-switch>
            </el-form-item>
          </el-col>-->
          <el-col :span="12">
            <el-form-item label="盘点时间" prop="inventoryTime">
              <el-date-picker v-model="form.inventoryTime" value-format="yyyy-MM-dd" type="date" :default-value="new Date()" style="width: 100%"
                              placeholder="选择日期时间">
              </el-date-picker>
            </el-form-item>
          </el-col>

        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="盘点范围" prop="inventoryRange"  >
              <!--              <el-input v-model="form.inventoryType" :disabled="true" ></el-input>-->
              <el-select v-model="form.inventoryRange" placeholder="盘点范围" clearable style="width: 100%">
                <el-option label="仓库" value="仓库"></el-option>
                <el-option label="物料分类" value="物料分类"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="盘点方法" prop="inventoryMethod"  >
              <!--              <el-input v-model="form.inventoryType" :disabled="true" ></el-input>-->
              <el-select v-model="form.inventoryMethod" placeholder="请选择盘点方法" clearable style="width: 100%">
                <el-option label="明盘" value="明盘"></el-option>
                <el-option label="盲盘" value="盲盘"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
<!--     盘点范围是按物料分类   -->
        <el-row v-if="form.inventoryRange =='物料分类'">
         <el-col :span="24">
           <el-form-item label="物料分类" prop="itemTypeIdRange"  >
             <treeselect
               :multiple="true"
               :options="options"
               value-consists-of="LEAF_PRIORITY"
               v-model="selectItemTypeList"
               placeholder="请选择物料分类"
               @input="handleInput"
               value-format="object"
             />
           </el-form-item>

         </el-col>
        </el-row>
        <!--     盘点范围是按仓库 进行判断  -->
        <el-row v-if="form.inventoryRange =='仓库'">
                    <el-col :span="8">
                      <el-form-item label="仓库" prop="warehouseId">
                        <el-select v-model="form.warehouseId" placeholder="请选择仓库" @change="handleWarehouseChange">
                          <el-option
                            v-for="warehouse in warehouseList"
                            :key="warehouse.warehouseId"
                            :label="warehouse.warehouseName"
                            :value="warehouse.warehouseId">
                          </el-option>
                        </el-select>
                      </el-form-item>
                    </el-col>
                   <el-col :span="8">
                      <el-form-item label="库区" prop="locationId">
                        <el-select v-model="form.locationId" placeholder="请选择库区" @change="handleLocationChange">
                          <el-option
                            v-for="item in locationList"
                            :key="item.locationId"
                            :label="item.locationName"
                            :value="item.locationId">
                          </el-option>
                        </el-select>
                      </el-form-item>
                    </el-col>
                     <el-col :span="8">
                           <el-form-item label="库位" prop="areaId">
                             <el-select v-model="form.areaId" placeholder="请选择库区" @change="handleAreaChange">
                               <el-option
                                 v-for="item in areaList"
                                 :key="item.areaId"
                                 :label="item.areaName"
                                 :value="item.areaId">
                               </el-option>
                             </el-select>
                         </el-form-item>
                      </el-col>
<!--          <el-col :span="12">
            <el-form-item label="仓库">
              <el-cascader v-model="warehouseInfo" ref="selectck"
                           :options="warehouseOptions"
                           :props="warehouseProps"
                           style="width:100%"
                           @change="handleWarehouseChanged"
              >
              </el-cascader>
            </el-form-item>
          </el-col>-->
        </el-row>
        <el-row >
          <el-col :span="8">
            <el-form-item label="盘点人" prop="inventoryPerson">
              <el-input v-model="form.inventoryPerson" readonly placeholder="请选择盘点人" >
                <el-button slot="append" @click="handleUserSelect"  icon="el-icon-search"></el-button>
              </el-input>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="盘点状态" prop="status" >
<!--              <el-input v-model="form.status" :disabled="true" ></el-input>-->
              <el-select v-model="form.status" placeholder="请选择盘点状态" :disabled="true" clearable>
                <el-option label="未盘点" value="0"></el-option>
                <el-option label="盘点中" value="1"></el-option>
                <el-option label="已提交" value="2"></el-option>
                <el-option label="已处理" value="3"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="盘点类型" prop="inventoryType" >
              <el-input v-model="form.inventoryType" :disabled="true" ></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>

          <el-col :span="24">
            <el-form-item label="备注" prop="inventoryDesc">
              <el-input v-model="form.inventoryDesc" type="textarea" placeholder="请输入备注"  maxlength="250"/>
            </el-form-item>
          </el-col>
        </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <UserSingleSelect ref="userSelect" @onSelected="onUserSelected"></UserSingleSelect>
    <pan-dian-edit ref="pdEdit" :title="title" :optType="optType" v-if="pdvisible" @refreshDataList="getList"></pan-dian-edit>
<!--    提交就用点击“盘点"时的页面-->
<!--    <ti-jiao ref="tijiao" :title="title" v-if="tjvisible" @refreshDataList="getList"></ti-jiao>-->
    <pan-dian-detail ref="pdDetail" :title="title" v-if="devisible" @refreshDataList="getList"></pan-dian-detail>
    <printdetail ref="printDetail" :title="title" v-if="printDevisible"></printdetail>
  </div>
</template>

<script>
// import the component
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'

import { getAreaList} from "@/api/mes/wm/area";
import { getLocationList} from "@/api/mes/wm/location";
import {getTreeList, getWarehouseList} from "@/api/mes/wm/warehouse";
import { listPandian, getPandian, delPandian, addPandian, updatePandian,handlePlusAndLoss } from "@/api/mes/wm/pandian";
import {genCode} from "@/api/system/autocode/rule";
import {listWmstock} from "@/api/mes/wm/wmstock";
import UserSingleSelect from "@/components/userSelect/single.vue"
import PanDianEdit from "./edit.vue"
import TiJiao from "./tijiao.vue"
import PanDianDetail from "./detail.vue"
import Printdetail from "@/views/mes/wm/pandian/printdetail.vue";
import {treeselect} from "@/api/mes/md/itemtype";
export default {
  name: "Pandian",
  components: {UserSingleSelect,PanDianEdit,TiJiao,PanDianDetail,Printdetail,Treeselect},
  data() {
    return {
      optType: undefined,
      //选择的物料分类
      selectItemTypeList:[],
      options:[],
      pdvisible:false,
      tjvisible:false,
      devisible:false,
      printDevisible:false,
      // warehouseInfo: [],
      warehouseOptions: [],
      warehouseProps: {
        multiple: false,
        value: 'pId',
        label: 'pName',
      },
      warehouseList:[],
      locationList:[],
      areaList:[],
      //自动生成编码
      autoGenFlag:false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      //选中盘点单号
      pdno:[],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 库存盘点表格数据
      pandianList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        sn: null,        warehouseName: null,        locationName: null,        areaName: null,        inventoryPerson: null,        status: null,      },
      // 表单参数
      form: {
        status:'0'
      },
      // 表单校验
      rules: {
        sn: [
          { required: true, message: "盘点单编号不能为空", trigger: "blur" }
        ],
        inventoryTime: [
          { required: true, message: "盘点时间不能为空", trigger: "blur"}
        ],
        warehouseId: [
          { required: true, message: "仓库不能为空", trigger: "blur"}
        ],
        inventoryRange: [
          { required: true, message: "盘点范围不能为空", trigger: "blur"}
        ],
        inventoryMethod: [
          { required: true, message: "盘点方法不能为空", trigger: "blur"}
        ],
        inventoryPerson: [
          { required: true, message: "盘点人不能为空", trigger: "blur"}
        ]

      }
    };
  },
  activated() {
    if (localStorage.getItem("IndexRefresh") == "true") {
      localStorage.setItem("IndexRefresh", false);
      this.getList();
    }
  },

  created() {
    this.getList();
    this.getWarehouse()
    // this.getWarehouseList();
    this.getTreeselect()
  },
  methods: {
    /** 查询分类下拉树结构 */
    getTreeselect() {
      treeselect().then(response => {
        this.options = response.data;
        console.log("qqqqqqqqqqqqqqqqqqqqqqqqqq",response.data)
      });
    },
    handleClose(){
      this.cancel()
    },
    handlePlusAndLoss(row){
      console.log("ssss",row.id)
      handlePlusAndLoss(row.id).then(response =>{
        // this.$modal.msgSuccess(response);
        this.$modal.msgSuccess("处理成功");
        this.getList();
      })
    },
    handleInput(selectedNodes){
      console.log("11111111111",selectedNodes)
      // 获取所有id
      var ids = selectedNodes.map(function(item) {
        return item.id;
      });
      console.log("IDs:", ids);
// 获取所有label
      var labels = selectedNodes.map(function(item) {
        return item.label;
      });
      console.log("Labels:", labels);
      this.form.itemTypeIdRange=ids.join(",")
      this.form.itemTypeNameRange=labels.join(",")
    },
    //选择默认的仓库、库区、库位
    handleWarehouseChanged(obj) {
      console.log(111111)
      const selectedNodes = this.$refs.selectck.getCheckedNodes();
      if(obj !=null){
        this.form.warehouseId = obj[0];
        this.form.locationId = obj[1];
        this.form.areaId = obj[2];
        this.form.warehouseName=selectedNodes[0].pathLabels[0]
        this.form.locationName=selectedNodes[0].pathLabels[1]
        this.form.areaName=selectedNodes[0].pathLabels[2]
      }
    },
    getWarehouseList() {
      getTreeList().then(response => {
        if (response.data) {
          this.warehouseOptions = response.data.filter((el) => {
            return el.warehouseCode.indexOf('VIR') == -1;
          });
          ;
        }
        this.warehouseOptions.map(w => {
          w.children.map(l => {
            let lstr = JSON.stringify(l.children).replace(/locationId/g, 'lId').replace(/areaId/g, 'pId').replace(/areaName/g, 'pName');
            l.children = JSON.parse(lstr);
          });

          let wstr = JSON.stringify(w.children).replace(/warehouseId/g, 'wId').replace(/locationId/g, 'pId').replace(/locationName/g, 'pName');
          w.children = JSON.parse(wstr);

        });
        let ostr = JSON.stringify(this.warehouseOptions).replace(/warehouseId/g, 'pId').replace(/warehouseName/g, 'pName');
        this.warehouseOptions = JSON.parse(ostr);
      });
    },
    //获取仓库
    getWarehouse(){
      this.warehouseList=[]
      getWarehouseList().then(response => {
        this.warehouseList = response.data.filter((el) =>{
          return el.warehouseCode.indexOf('VIR') == -1;
        })
      });
    },
    //获取库区
    getLocation(warehouseId){
      this.locationList=[]
      getLocationList({warehouseId:warehouseId}).then(response => {
        this.locationList = response.data;
      });
    },
    //获取库位
    getArea(locationId){
      this.areaList=[]
      getAreaList({locationId:locationId}).then(response => {
        this.areaList = response.data;
      });
    },
    //选择仓库
    handleWarehouseChange(value){
      this.form.locationId=''
      this.form.locationName=''
      this.form.areaId=''
      this.form.areaName=''
      this.form.warehouseName=this.warehouseList.filter(item => item.warehouseId === value)[0].warehouseName
      //根据所选仓库 获取库区
      this.getLocation(value)
    },
//选择库位
    handleLocationChange(value){
      this.form.areaId=''
      this.form.areaName=''
      this.form.locationName=this.locationList.filter(item => item.locationId === value)[0].locationName
      console.log("wwww",this.form.locationName)
      this.getArea(value)
    },
    //选择库区
    handleAreaChange(value){
      this.form.areaName=this.areaList.filter(item => item.areaId === value)[0].areaName
      console.log("qqqq",this.form.areaName)
    },

    //点击人员选择按钮
    handleUserSelect(){
      this.$refs.userSelect.showFlag = true;
    },
    //人员选择返回
    onUserSelected(row){
      this.form.inventoryPerson= row.nickName;
      this.form.inventoryPersonId= row.userId;

    },
    //自动生成编码
    handleAutoGenChange(autoGenFlag){
      if(autoGenFlag){
        genCode('PANDIAN_CODE').then(response =>{
          this.form.sn = response;
        });
      }else{
        this.form.sn = null;

      }
    },
    handleView(row){
      // this.$router.push({path: '/detailPandian',query: {id: row.id}});
      this.devisible=true
      this.title="详情"
      this.$nextTick(() => {
        this.$refs.pdDetail.init(row.id)
      })
    },
    handlePrint(row){
      this.printDevisible=true
      this.title="打印预览"
      this.$nextTick(() => {
        this.$refs.printDetail.init(row.id)
      })
    },
    /** 查询库存盘点列表 */
    getList() {
      this.loading = true;
      listPandian(this.queryParams).then(response => {
        this.pandianList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,        sn: null,        warehouseId: null,        warehouseName: null,        locationId: null,        locationName: null,        areaId: null,        areaName: null,        inventoryPersonId: null,        inventoryPerson: null,
        inventoryTime: new Date().toISOString().split('T')[0],        inventoryDesc: null,        status: null,        rejectReason: null,        auditTime: null,        auditPersonId: null,        auditPersonName: null,        createBy: null,        createTime: null,        updateBy: null, updateTime: null , inventoryType:'静态', inventoryMethod:null,inventoryRange:null,itemTypeIdRange:null,itemTypeNameRange:null};
      this.resetForm("form");
      this.selectItemTypeList=[]
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.pdno= selection.map(item => item.sn)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      // this.$router.push({path: '/addPandian'});
      this.reset();
      genCode('PANDIAN_CODE').then(response =>{
        this.form.sn = response;
      });
      this.warehouseList=[]
      this.locationList=[]
      this.areaList=[]
      this.getWarehouse()
      this.form.status='0'
      this.form.inventoryType='静态'
      this.open = true;
      this.title = "添加盘点单";
      this.optType='add'

    },
    /** 修改按钮操作 */
    handleUpdate(row) {
        // this.$router.push({path: '/editPandian',query: {id: row.id}});
      this.optType='edit'
      this.pdvisible=true
      this.title="进行盘点"
      this.$nextTick(() => {
        this.$refs.pdEdit.init(row.id)
      })
    },
    tijiao(row){
      this.optType='tijiao'
      // this.tjvisible=true
      this.pdvisible=true
      this.title="提交"
      this.$nextTick(() => {
        this.$refs.pdEdit.init(row.id)
        // this.$refs.tijiao.init(row.id)
      })
      // this.$router.push({path: '/tijiaoPandian',query: {id: row.id}});
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if(this.form.inventoryRange =='物料分类'){
            if(!this.selectItemTypeList.length >0){
              this.$message.warning("物料分类不能为空")
              return
            }
          }
          if(this.form.inventoryRange =='仓库'){
            console.log("dddd",this.form.warehouseId)
            if(!this.form.warehouseId){
              this.$message.warning("仓库不能为空")
              return;
            }
          }
          if (this.form.id != null) {
            updatePandian(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addPandian(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除库存盘点编号为"' + this.pdno + '"的数据项？').then(function() {
        return delPandian(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('mes/wm/pandian/export', {
        ...this.queryParams
      }, `pandian_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
